package cn.tedu.basic;

//测试  反射
public class Test2_Reflection {
    public static void main(String[] args) throws Exception {
        Method();//获取Class对象
    }
    private static void Method() throws Exception {
        Class c = Class.forName("java.lang.String");//全路径名
        Class c1 = String.class;//类名.Class
        Class c2 = new String().getClass();//对象.getClass
        System.out.println(c);
        System.out.println(c1);
        System.out.println(c2);
        Student s =new Student();
        System.out.println(s.age);
    }
}
class Student{
    public Student(){}
    public int age =18;
    public String name ="liuyun";
    public Student(int a,String b){
        this.age=19;
        this.name="ruanfeifei";
        System.out.println(age);
    }
    public Student(int a){
        System.out.println(19);
    }
    public static void make(int a){
        System.out.println("make()-"+a);
    }
    private static void get(){
        System.out.println("night");
    }
    public static void wash(String b){
        System.out.println("with me");
    }
}